package com.ruoyi.project.system.service.impl;

import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.redis.RedisCache;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.domain.SysMobileUser;
import com.ruoyi.project.system.mapper.SysMobileUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysUserServiceMapper;
import com.ruoyi.project.system.domain.SysUserService;
import com.ruoyi.project.system.service.ISysUserServiceService;

/**
 * 用户收藏服务Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-25
 */
@Service
public class SysUserServiceServiceImpl implements ISysUserServiceService 
{
    @Autowired
    private SysUserServiceMapper sysUserServiceMapper;

    @Autowired
    private RedisCache redisCache;

    @Autowired
    private SysMobileUserMapper sysMobileUserMapper;

    /**
     * 查询用户收藏服务
     * 
     * @param typeDetailId 用户收藏服务ID
     * @return 用户收藏服务
     */
    @Override
    public SysUserService selectSysUserServiceById(Long typeDetailId)
    {
        return sysUserServiceMapper.selectSysUserServiceById(typeDetailId);
    }

    /**
     * 查询用户收藏服务列表
     * 
     * @param sysUserService 用户收藏服务
     * @return 用户收藏服务
     */
    @Override
    public List<SysUserService> selectSysUserServiceList(SysUserService sysUserService)
    {
        return sysUserServiceMapper.selectSysUserServiceList(sysUserService);
    }

    /**
     * 新增用户收藏服务
     * 
     * @param sysUserService 用户收藏服务
     * @return 结果
     */
    @Override
    public int insertSysUserService(SysUserService sysUserService)
    {
        sysUserService.setCreateTime(DateUtils.getNowDate());
        sysUserService.setDelFlag("0");
        return sysUserServiceMapper.insertSysUserService(sysUserService);
    }

    /**
     * 修改用户收藏服务
     * 
     * @param sysUserService 用户收藏服务
     * @return 结果
     */
    @Override
    public int updateSysUserService(SysUserService sysUserService)
    {
        sysUserService.setUpdateTime(DateUtils.getNowDate());
        return sysUserServiceMapper.updateSysUserService(sysUserService);
    }

    /**
     * 批量删除用户收藏服务
     * 
     * @param typeDetailIds 需要删除的用户收藏服务ID
     * @return 结果
     */
    @Override
    public int deleteSysUserServiceByIds(Long[] typeDetailIds)
    {
        return sysUserServiceMapper.deleteSysUserServiceByIds(typeDetailIds);
    }

    /**
     * 删除用户收藏服务信息
     * 
     * @param typeDetailId 用户收藏服务ID
     * @return 结果
     */
    @Override
    public int deleteSysUserServiceById(Long typeDetailId)
    {
        return sysUserServiceMapper.deleteSysUserServiceById(typeDetailId);
    }
    
    @Override
    public List<SysUserService> queryMyService(Long MobileUserId) {

        return sysUserServiceMapper.queryMyService(MobileUserId);
    }

    @Override
    public SysUserService queryRepeat(SysUserService sysUserService) {
        return sysUserServiceMapper.queryRepeat(sysUserService);
    }

    @Override
    public int deleteMyService(SysUserService sysUserService) {
        return sysUserServiceMapper.deleteMyService(sysUserService);
    }

    @Override
    public int deleteAllService(SysUserService sysUserService) {
        return sysUserServiceMapper.deleteAllService(sysUserService);
    }

    @Override
    public int queryAllServiceCount(Long mobileUserId) {
        return sysUserServiceMapper.queryAllServiceCount(mobileUserId);
    }

    @Override
    public List<SysUserService> querymyservice(SysUserService sysUserService) {
        return sysUserServiceMapper.querymyservice(sysUserService);
    }
}
